package com.project.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.project.bean.CategoryBean;
import com.project.bean.CommentBean;
import com.project.mapper.ICategoryMapper;
import com.project.mapper.ICommentMapper;
import com.project.service.ICategoryService;
import com.project.service.ICommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.crypto.Mac;
import java.util.List;

@Service
@Transactional
public class CommentServiceImp implements ICommentService {
    @Autowired
    private ICommentMapper mapper;

    @Override
    public List<CommentBean> findById(Integer newId) {
        QueryWrapper qw = new QueryWrapper<>();
        qw.eq("fk_newId",newId);
        return mapper.selectList(qw);
    }

    @Override
    public void add(CommentBean commentBean) {
        mapper.insert(commentBean);
    }
}
